import request from "@/utils/request";
export const service = () => {
  return !!JSON.parse(localStorage.$loginInfo).tenantId ? "/event" : "/event";
};
export function getTreeSelect(query) {
  return request({
    url: "/admin/base/system/area/treeselect",
    method: "get",
    data: query,
  });
}
// 查询行政区域列表
export function getTenantTree(query) {
  return request({
    url: "/admin/custom/manage/getTenantTree",
    method: "post",
    data: query,
  });
}

// 批量更新客户信息
export function updateTenantInfoBatch(query) {
  return request({
    url: "/admin/custom/manage/updateTenantInfoBatch",
    method: "post",
    data: query,
  });
}

// 获取订单客户列表数据
export function getOrderTenantInfo(query) {
  return request({
    url: "/admin/custom/manage/getOrderTenantInfo",
    method: "post",
    data: query,
  });
}

// 关键字查询租户信息列表(铁塔视角)
export function queryTenantInfo(query) {
  return request({
    url: "/admin/custom/manage/queryTenantInfo",
    method: "post",
    data: query,
  });
}

// 获取配置权限
export function getAuthConfig(query) {
  return request({
    url: "/admin/custom/manage/getAuthConfig",
    method: "post",
    data: query,
  });
}

// 创建配置权限
export function createAuthConfig(query) {
  return request({
    url: "/admin/custom/manage/createAuthConfig",
    method: "post",
    data: query,
  });
}

// 修改配置权限
export function updateTenantInfo(query) {
  return request({
    url: "/admin/custom/manage/updateTenantInfo",
    method: "post",
    data: query,
  });
}

// 获取订单信息
export function queryTenantOrder(query) {
  return request({
    url: "/admin/custom/manage/queryTenantOrder",
    method: "post",
    data: query,
  });
}

// 查询研判节点
export function queryPlatformList(data) {
  return request({
    url: "/admin/custom/manage/queryPlatformList",
    method: "post",
    data,
  });
}

// 查询批量研判列表
export function queryTenantList(data) {
  return request({
    url: "/admin/custom/manage/queryTenantList",
    method: "post",
    data,
  });
}

export function getOrderListForOperate(query) {
  return request({
    url: service() + "/alarm/order/operate/getOrderListForOperate",
    method: "post",
    data: query,
  });
}
//
export function checkAlarmOrder(query) {
  return request({
    url: service() + "/alarm/order/operate/checkAlarmOrder",
    method: "post",
    data: query,
  });
}

//获取api列表
export function qryApilntflnfoList(query) {
  return request({
    url: "/manage/apiIntfMange/info/qryApiIntfInfoList",
    method: "post",
    data: query,
  });
}

//获取客户行业应用
export function qryIndustryAndAppVerByTenantId(query) {
  return request({
    url: "/manage/industry/code/qryIndustryAndAppVerByTenantId",
    method: "post",
    data: query,
  });
}
//获取客户行业应用
export function findListByTenantId(query) {
  return request({
    url: "/event/alarm/type/findListByTenantId",
    method: "post",
    data: query,
  });
}
//查询客户下的告警类型
export function getAlarmTypeList(query) {
  return request({
    url: "/event/alarm/type/getAlarmTypeList",
    method: "post",
    data: query,
  });
}
//获取客户ID
export function genCustomerId() {
  return request({
    url: "/order/video/order/genCustomerId",
    method: "post",
  });
}
//新增客户
export function addCustomer(data) {
  return request({
    url: "/order/video/order/addCustomer",
    method: "post",
    data: data,
  });
}
//编辑客户信息
export function updateCustomer(data) {
  return request({
    url: "/order/video/order/updateCustomer",
    method: "post",
    data: data,
  });
}
//查询客户详情信息
export function getCustomerInfo(customerCode) {
  return request({
    url: `/order/video/order/getCustomerInfo/${customerCode}`,
    method: "post",
  });
}
//校验客户订单
export function checkOrderExist(customerCode) {
  return request({
    url: `/order/video/order/checkOrderExist/${customerCode}`,
    method: "post",
  });
}
//删除客户
export function deleteCustomer(customerCode) {
  return request({
    url: `/order/video/order/deleteCustomer/${customerCode}`,
    method: "post",
  });
}
//客户订购详情
export function getOrderList(customerCode) {
  return request({
    url: `/order/video/order/getOrderList/${customerCode}`,
    method: "post",
  });
}
//可订购应用版本列表
export function queryAllIndustryAndVersion() {
  return request({
    url: `/manage/industry/conf/queryAllIndustryAndVersion`,
    method: "post",
  });
}
//查询可以订购的设备列表
export function getDeviceMonitorTree() {
  return request({
    url: `/device/video/getDeviceMonitorTree`,
    method: "post",
  });
}
//查询可以订购的算法列表
export function queryAlgorithmTree() {
  return request({
    url: `/device/video/order/queryAlgorithmTree`,
    method: "post",
  });
}
//查询可以订购的物联设备列表
export function getIotMonitorTree(data) {
  return request({
    url: `/device/iotDeviceTT/ttview/device/getIotMonitorTree`,
    method: "post",
    data,
  });
}
//查询可以订购的雷达列表
export function getRadarMonitorTree(data) {
  return request({
    url: `/device/radarTT/getRadarMonitorTree`,
    method: "post",
    data,
  });
}

//订购接口
export function addOrUpdateOrder(orders) {
  return request({
    url: `/order/video/order/addOrUpdateOrder`,
    method: "post",
    data: orders,
  });
}
//获取未被选择的级联平台信息
export function findCascadeList(data) {
  return request({
    url: `/device/device/findCascadeList`,
    method: "post",
    data: data,
  });
}

//级联平台信息绑定下发
export function cascadeBinding(data) {
  return request({
    url: `/device/device/cascadeBinding`,
    method: "post",
    data: data,
  });
}
// 获取运营研判用户记忆
export function getUserMemoryOperate(data) {
  return request({
    url: `ttevent/alarm/order/operate/getUserMemoryOperate`,
    method: "post",
    data: data,
  });
}
// 新增、编辑 运营研判用户记忆
export function insertUserMemoryOperate(data) {
  return request({
    url: `ttevent/alarm/order/operate/insertUserMemoryOperate`,
    method: "post",
    data: data,
  });
}
// 查询节点
export function queryListByKey(data) {
  return request({
    url: `cascade/platformData/queryListByKey`,
    method: "post",
    data: data,
  });
}
// 查询客户级联配置接口
export function queryCascadeInfoList(data) {
  return request({
    url: `device/device/queryCascadeInfoList`,
    method: "post",
    data: data,
  });
}

// 推送列表的查询接口
export function queryOperationPushList(data) {
  return request({
    url: "/admin/custom/manage/queryOperationPushList",
    method: "post",
    data: data,
  });
}

// 查询客户级联配置接口
export function pushOperationInfo(data) {
  return request({
    url: `/admin/custom/manage/pushOperationInfo`,
    method: "post",
    data: data,
  });
}

// 查询第三方告警配置
export function queryThirdAlarm(data) {
  return request({
    url: `/admin/custom/manage/queryThirdAlarm`,
    method: "post",
    data: data,
  });
}

// 第三方告警配置
export function updateThirdAlarm(data) {
  return request({
    url: `/admin/custom/manage/updateThirdAlarm`,
    method: "post",
    data: data,
  });
}

// 查询地图配置信息
export function queryTenantMapConfigInfo(data) {
  return request({
    url: "/admin/custom/manage/queryTenantMapConfigInfo",
    method: "post",
    data: data,
  });
}

// 新增/修改地图配置信息
export function saveTenantMapConfig(data) {
  return request({
    url: "/admin/custom/manage/saveTenantMapConfig",
    method: "post",
    data: data,
  });
}
